<?php
namespace Home\Controller;
class IndexController extends CommonController {
    public function index(){
    	//$this->uid = session('_loginUser_home')['uid'];
    	//幻灯片
    	$contents = D('Contents')->where(array('cid'=>'11'))->relation(true)->field('*')->limit(5)->select();
//     	dump($contents);
    	$this->contents = $contents;
    	$this->display();
    }
    
    public function article(){
    	$id = I('id');
    	$info = D('Contents')->where(array('id'=>$id))->relation(true)->find();
    	
    	$this->info = $info;
    	$this->display();
    }
 	
//     public function step2(){
//     	$stuname = I('get.stuname');
//     	$tel = I('get.tel');
//     	$birthday = I('get.birthday');
//     	$where['name'] = $stuname;
//     	$where['tel'] = $tel;
//     	$os = M('YgclOldstudent')->where($where)->find();
//     	if($os){
//     		$this->studentstatus = 1;//老生
//     	}else{
//     		$this->studentstatus = 0;//新生
//     	}
    	
//     	$this->tar = round(getMonthNum($birthday,date('Y-m-d'))/12,1);//年龄段
    	
//     	$this->stuname = $stuname;
//     	$this->tel = $tel;
//     	$this->birthday = $birthday;
//     	$this->uid = session('_loginUser_home')['uid'];
//     	$this->display();
//     }
    
    //预约
	public function yuyue(){
	  	$this->uid = session('_loginUser_home')['uid'];
	  	$check_tiyan = R('Api/Tiyan/check_tiyan',array('uid'=>$this->uid));
	  	if($check_tiyan){
	  		$this->money = 1;
	  	}else{
	  		$this->money = 0;
	  	}
	  	$this->display();
	}
	
	//其他
	public function qita(){
		$t = I('t');
		if($t == 'dy'){
			$this->class = "陶艺/DIY";
		}elseif ($t == 'crb'){
			$this->class = '成人班';
		}
		$this->display();
	}

	public function summer(){
		$this->display();
	}
    
    public function step3(){
    	$map['id'] = I('get.id',0);
    	$this->info = D('YgclOrder')->where($map)->find();
    	$this->display();
    }
    

}